version: "3.3"

services:
  db:
    container_name: postgres
    image: postgres
    build:
      context: ./db
    env_file:
      - ./.env
    networks:
      - network
    ports:
      - 5432:5432

  graphql:
    container_name: graphql
    image: graphql
    build:
      context: ./graphql
    env_file:
      - ./.env
    depends_on:
      - db
    networks:
      - network
    ports:
      - 5001:5000
    command:
      - --connection
      - postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/graphile
      - --schema
      - learning_graphile
      - --enhance-graphiql
      - --append-plugins
      - postgraphile-plugin-connection-filter

networks:
  network:
